home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / J-M / MegaHome II.cpt / MegaHome II / Preferences / card_2837.txt < prev    next >
Text File  |  1990-11-11  |  6KB  |  185 lines

  1. -- card: 2837 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2633
  5. -- name: 
  6.  
  7.  
  8. -- part 2 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=16 top=7 right=29 bottom=209
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Restore Saved Preferences
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   global userName,id,clickSpeed,autoC,powerUser,dr,coords,mX,screenS
  23.   global shiftT,adsI,mHomeVers,vPfA,dragDelay
  24.   if mHomeVers is empty then
  25.     beep 2
  26.     answer"MegaHome is not installed." with "Cancel"
  27.     exit mouseUp
  28.   end if
  29.   answer file "Choose a file from which to restore your Preferences." of type "MHPF"
  30.   go to this cd
  31.   put it into fn
  32.   if fn is empty then exit mouseUp
  33.   set the cursor to 4
  34.   open file fn
  35.   read from file fn for 1
  36.   if charToNum(it)<4 or charToNum(it)>5 then
  37.     answer "This file is corrupted or was created with an old version of MegaHome Preferences, and can not be used." with "Cancel"
  38.     if it is "Cancel" then
  39.       close file fn
  40.       exit mouseUp
  41.     end if
  42.   end if
  43.   put false into v
  44.   if charToNum(it) is 4 then
  45.     put "(MegaHome I File)"
  46.     put true into v
  47.   end if
  48.   read from file fn for 1
  49.   read from file fn for charToNum(it)-1
  50.   put it into userName
  51.   read from file fn for 1
  52.   get binary(charToNum(it))
  53.   set the userLevel to decimal("00000"&(char 1 to 3 of it))
  54.   if the version‚â•"1.2" then set the textArrows to (char 4 of it is "1")
  55.   set the powerKeys to (char 5 of it is "1")
  56.   set the blindTyping to (char 6 of it is "1")
  57.   put (char 7 of it is "1") into powerUser
  58.   put (char 8 of it is "1") into shiftT
  59.   read from file fn for 1
  60.   get binary(charToNum(it))
  61.   put (decimal("000000"&(char 1 to 2 of it)))+1 into clickSpeed
  62.   put (decimal("000000"&(char 3 to 4 of it)))-1 into screenS
  63.   put (char 5 of it is "1") into autoC
  64.   put (char 6 of it is "1") into mX
  65.   put (char 7 of it is "1") into dr
  66.   put (char 8 of it is "1") into coords
  67.   if v is false then
  68.     read from file fn for 1
  69.     get binary(charToNum(it))
  70.     put (decimal("000000"&(char 1 to 2 of it)))-1 into dragDelay
  71.     set the scriptTextSize to (decimal("00"&(char 3 to 8 of it)))
  72.   end if
  73.   read from file fn for 5
  74.   put it-32768 into id
  75.   read from file fn for 5
  76.   put it-32768 into adsI
  77.   if v is false then
  78.     read from file fn for 1
  79.     read from file fn for charToNum(it)-1
  80.     if not fontExists(it,0) then
  81.       put "The font ‚Äú"&it&"‚Äù is missing from your system."
  82.       get "Monaco"
  83.     end if
  84.     set the scriptTextFont to it
  85.   end if
  86.   close file fn
  87.   lock screen
  88.   push cd
  89.   go home
  90.   put the textArrows into cd fld "Prefs"
  91.   put return&the powerKeys after cd fld "Prefs"
  92.   put return&the blindTyping after cd fld "Prefs"
  93.   put return&powerUser after cd fld "Prefs"
  94.   put return&userName after cd fld "Prefs"
  95.   put return&mX after cd fld "Prefs"
  96.   put return&coords after cd fld "Prefs"
  97.   put return&dr after cd fld "Prefs"
  98.   put return&the userLevel after cd fld "Prefs"
  99.   put return&clickSpeed after cd fld "Prefs"
  100.   put return&id after cd fld "Prefs"
  101.   put return&autoC after cd fld "Prefs"
  102.   put return&screenS after cd fld "Prefs"
  103.   put return&shiftT after cd fld "Prefs"
  104.   put return&adsI after cd fld "Prefs"
  105.   put return&dragDelay after cd fld "Prefs"
  106.   put return&the scriptTextFont&","&the scriptTextSize after cd fld "Prefs"
  107.   updMenus
  108.   pop cd
  109.   hide msg
  110. end mouseUp
  111.  
  112.  
  113. -- part 5 (button)
  114. -- low flags: 00
  115. -- high flags: A003
  116. -- rect: left=16 top=35 right=57 bottom=209
  117. -- title width / last selected line: 0
  118. -- icon id / first selected line: 0 / 0
  119. -- text alignment: 1
  120. -- font id: 0
  121. -- text size: 12
  122. -- style flags: 0
  123. -- line height: 16
  124. -- part name: Save Current Preferences
  125. ----- HyperTalk script -----
  126. on mouseUp
  127.   global userName,id,clickSpeed,autoC,powerUser,dr,coords,mX,screenS
  128.   global shiftT,adsI,mHomeVers,dragDelay,vPfA
  129.   if mHomeVers is empty then
  130.     beep 2
  131.     answer"MegaHome is not installed." with "Cancel"
  132.     exit mouseUp
  133.   end if
  134.   put newFileName("Save preferences as:","MegaHome Preferences") into fn
  135.   go to this card
  136.   if fn is empty then exit mouseUp
  137.   set the cursor to 4
  138.   open file fn
  139.   write numToChar(vPfA) to file fn
  140.   write numToChar((the number of chars of userName)+1)&userName to file fn
  141.   put char 6 to 8 of binary(the userLevel) into bin
  142.   if the textArrows is true then put "1" after bin else put "0" after bin
  143.   if the powerKeys is true then put "1" after bin else put "0" after bin
  144.   if the blindTyping is true then put "1" after bin else put "0" after bin
  145.   if powerUser is true then put "1" after bin else put "0" after bin
  146.   if shiftT is true then put "1" after bin else put "0" after bin
  147.   write binToChar(bin) to file fn
  148.   put char 7 to 8 of binary(clickSpeed-1) into bin
  149.   put char 7 to 8 of binary(screenS+1) after bin
  150.   if autoC is true then put "1" after bin else put "0" after bin
  151.   if mX is true then put "1" after bin else put "0" after bin
  152.   if dr is true then put "1" after bin else put "0" after bin
  153.   if coords is true then put "1" after bin else put "0" after bin
  154.   write binToChar(bin) to file fn
  155.   put char 7 to 8 of binary(dragDelay+1) into bin
  156.   put char 3 to 8 of binary(the scriptTextSize) after bin
  157.   write binToChar(bin) to file fn
  158.   set the numberFormat to "00000"
  159.   set the icon of btn x to id
  160.   put the icon of btn x into id
  161.   put id+32768 into temp
  162.   write temp to file fn
  163.   set the icon of btn x to adsI
  164.   put the icon of btn x into adsI
  165.   put adsI+32768 into temp
  166.   write temp to file fn
  167.   write numToChar((the number of chars of the scriptTextFont)+1)&the scriptTextFont to file fn
  168.   close file fn
  169.   get changeFileType(fn,"MHPF","ES01")
  170. end mouseUp
  171.  
  172.  
  173. -- part 9 (button)
  174. -- low flags: 80
  175. -- high flags: 0004
  176. -- rect: left=209 top=26 right=38 bottom=221
  177. -- title width / last selected line: 0
  178. -- icon id / first selected line: 1000 / 1000
  179. -- text alignment: 1
  180. -- font id: 0
  181. -- text size: 12
  182. -- style flags: 0
  183. -- line height: 16
  184. -- part name: x
  185.